<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>操作首页</title>
    <link rel="stylesheet" href="../../layui/css/layui.css"/>
    <script src="../../layui/layui.js"></script>
    <script>
        layui.use('element', function() {
            var $ = layui.jquery;  //加载jQuery模块
            var element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
        });
    </script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">华联后台管理系统(CRM)</div>

        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                    <script>
                        document.write(localStorage.getItem("name"))
                    </script>
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a id="logout" >退了</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
           <!-- lay-shrink: 展开时,收缩所有兄弟节点的子节点-->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test" lay-shrink="all">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">优惠券管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="../coupon/cpnList.html" target="menu-iframe" >优惠券管理</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">会员管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="../user/userList.html" target="menu-iframe" >会员管理列表</a></dd>
                    </dl>
                    <dl class="layui-nav-child">
                        <dd><a href="../user/myCpnList.html" target="menu-iframe" >会员优惠券</a></dd>
                    </dl>
                </li>
                <!--<li class="layui-nav-item">
                    <a href="javascript:;">用户管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="../user/userList.html" target="menu-iframe">用户列表</a></dd>
                        <dd><a href="javascript:;">列表二</a></dd>
                        <dd><a href="">超链接</a></dd>
                    </dl>
                </li>-->
                <li class="layui-nav-item"><a href="">云市场</a></li>
                <li class="layui-nav-item"><a href="">发布商品</a></li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;height:90%">

            <iframe id="menu-iframe" name="menu-iframe"  style="overflow: visible;height:100%" scrolling="auto" frameborder="no"  width="100%" height="100%"></iframe>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © layui.com - 底部固定区域
    </div>
</div>

<script src="../../layui/layui.js"></script>
<script>
    layui.use([ 'jquery'], function() {
        var $ = layui.jquery;

        $("#logout").click(function (){
            $.ajax({
                url:"/user"
                ,headers:{handlerType:"logout"}
                ,dataType:"json"
                ,success:function(res){
                    // 服务器执行登出成功
                    if(res.code == 1){
                        // 清除localStorage中的token
                        localStorage.removeItem("token");
                        // 跳转
                        window.location.href = "login.html";
                    }
                }
            })
        })

    })


 </script>
</body>


</html>